/*   **********************************************************************  **
 **   Copyright notice                                                       **
 **                                                                          **
 **   (c) 2009, Around(J2)ME				                                 **
 **   All rights reserved.                                                   **
 **                                                                          **
 **   This program and the accompanying materials are made available under   **
 **   the terms of the New BSD License which accompanies this    			 **
 **   distribution.											                 **
 **   A copy is found in the textfile LICENSE.txt							 **
 **                                                                          **
 **   This copyright notice MUST APPEAR in all copies of the file!           **
 **                                                                          **
 **   Main developers:                                                       **
 **     Juri Strumpflohner		http://blog.js-development.com	             **
 **		Matthias Braunhofer		http://matthias.jimdo.com                    **
 **                                                                          **
 **  **********************************************************************  */

package com.aroundj2me.utility;

import javax.microedition.lcdui.Alert;

import com.aroundj2me.model.Constants;
/**
 * Creates Alert messages
 *
 */
public class AlertCreator {
	//TODO center message on Alert-screen
	
	public static final int DELAY = 2000;
	
	public static Alert getErrorAlert(String message){
		Alert al = new Alert(Constants.ALERT_ERROR, message, ImageLoader.getImage(ImageLoader.WARNING), null);
		al.setTimeout(Alert.FOREVER);
		return al;
	}
	
	public static Alert getInfoAlert(String message){
		Alert al = new Alert(Constants.ALERT_INFO, message, ImageLoader.getImage(ImageLoader.INFO), null);
		al.setTimeout(DELAY);
		return al;
	}
	
	public static Alert getInfoAlert(String message, boolean userHasToClick){
		Alert al = getInfoAlert(message);
		if(userHasToClick)
			al.setTimeout(Alert.FOREVER);
		
		return al;
	}
	
}
